package ca.utoronto.utm.csc301.euchre.gamemanager;

import ca.utoronto.utm.csc301.euchre.player.Player;

public class Team {
	private Player[] players;
	private int score;
	private int tricksWonRound;
	
	public Team(Player one, Player two) {
		players = new Player[]{one, two};
		score = 0;
		
		resetTricksWon();
	}
	
	/**
	 * Return the specified player on this team.
	 * @param the id of the player needed
	 * @return the specified player on this team
	 */
	public Player getPlayer(int i) {
		if (i == 0) {
			return players[i];
		} else {
			return players[1];
		}
	}
	
	/**
	 * Reset the amount of tricks won between rounds.
	 */
	public void resetTricksWon() {
		tricksWonRound = 0;
	}
	
	/**
	 * Return the number of tricks this team has own in the current round.
	 * 
	 * @return
	 */
	public int getTricksWon() {
		return tricksWonRound;
	}
	
	/**
	 * Specify that this team has won another trick in this round.
	 */
	public void addVictory() {
		tricksWonRound++;
	}
	
	/**
	 * Return this team's current game points.
	 * @return this team's current game points
	 */
	public int getScore() {
		return score;
	}
	
	/**
	 * Update this team's current game points. 
	 * @param the new score that is to be set as the score of this team
	 */
	public void setScore(int newScore) {
		score = newScore;
	}
}
